import http from '../../utils/httpRequest'
export default {
  namespaced: true,
  state: {
    id: 0,
    name: '',
    tenantList: []
  },
  mutations: {
    updateId (state, id) {
      state.id = id
    },
    updateName (state, name) {
      state.name = name
    },
    updateTenantList(state, tenantList) {
      state.tenantList = tenantList
    }
  },
  actions: {
    async fetchTenantList({ commit }) {
      let res = await http.post('/tenant/getTenantList')
      commit('updateTenantList', res.data)
    }
  }
}
